package com.tc.jaskson.entity;

import com.fasterxml.jackson.annotation.*;
import lombok.AllArgsConstructor;

import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.Value;

import java.util.Date;

/**
 * @author :silence
 * @version :
 * @description
 * @date :2020/8/11 9:54
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@JsonPropertyOrder({"password","username"})  //设置返回的 字段顺序
public class User {
    @JsonIgnore   //设置忽视此字段
    private int id;
    @JsonProperty("name")  //更改返回字段的名字
    private String username;
    private String password;
    @JsonFormat(pattern = "yyyy/MM/dd")  //设置接收的格式
    private Date date;
    @JsonInclude(JsonInclude.Include.NON_NULL)  //如果此字段为空则不返还
    private String  title;

}
